package cn.edu.hbvtc.qms.web.struts.action;

import org.apache.struts.actions.DispatchAction;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

public abstract class AbstractBaseDispatchAction extends DispatchAction {
	protected UserDetails getPrincipal() {
		Authentication authentication = SecurityContextHolder.getContext()
				.getAuthentication();
		UserDetails userDetails = (UserDetails) authentication.getPrincipal();
		return userDetails;
	}
}
